import sys
#导入类
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

#面向对象：
class window(QWidget):
    def __init__(self, parent = None):
        super(window,self).__init__(parent)
        self.resize(200,50)
        self.setWindowTitle('PyQt5')
        self.label= QLabel(self)
        #添加一个QLabel对象，并将label的标题设置为"hello pyqt5"
        self.label.setText('hello Pyqt5')
        font=QFont()
        font.setFamily('Arial')
        font.setPointSize(16)
        self.label.setFont(font)
        self.label.move(50,20)
def main():
    app=QApplication(sys.argv)
    ex=window()
    ex.show()
    sys.exit(app.exec_())
if __name__=='__main__':
    main()